﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace NHModel.Entities
{
    public class UserInfo
    {
        #region Member Variables

        protected int _id;
        protected string _userName;
        protected string _passWord;
        protected string _email;
        protected string _tel;
        protected string _qQ;
        protected string _msn;
        protected string _moblie;
        protected int _isActive;
        protected int _nationality;
        protected int _sex;
        protected string _address;
        protected string _realName;
        protected DateTime _createTime;
        protected IList _userDocumentses;
        protected IList _userOrderses;


        #endregion

        #region Constructors

        public UserInfo() { }

        public UserInfo(string userName, string passWord, string email, string tel, string qQ, string msn, string moblie, int isActive, int nationality, int sex, string address, string realName, DateTime createTime)
        {
            this._userName = userName;
            this._passWord = passWord;
            this._email = email;
            this._tel = tel;
            this._qQ = qQ;
            this._msn = msn;
            this._moblie = moblie;
            this._isActive = isActive;
            this._nationality = nationality;
            this._sex = sex;
            this._address = address;
            this._realName = realName;
            this._createTime = createTime;
        }

        #endregion

        #region Public Properties

        public virtual int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public virtual string UserName
        {
            get { return _userName; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for UserName", value, value.ToString());
                _userName = value;
            }
        }

        public virtual string PassWord
        {
            get { return _passWord; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for PassWord", value, value.ToString());
                _passWord = value;
            }
        }

        public virtual string Email
        {
            get { return _email; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for Email", value, value.ToString());
                _email = value;
            }
        }

        public virtual string Tel
        {
            get { return _tel; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Tel", value, value.ToString());
                _tel = value;
            }
        }

        public virtual string QQ
        {
            get { return _qQ; }
            set
            {
                if (value != null && value.Length > 11)
                    throw new ArgumentOutOfRangeException("Invalid value for QQ", value, value.ToString());
                _qQ = value;
            }
        }

        public virtual string Msn
        {
            get { return _msn; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for Msn", value, value.ToString());
                _msn = value;
            }
        }

        public virtual string Moblie
        {
            get { return _moblie; }
            set
            {
                if (value != null && value.Length > 11)
                    throw new ArgumentOutOfRangeException("Invalid value for Moblie", value, value.ToString());
                _moblie = value;
            }
        }

        public virtual int IsActive
        {
            get { return _isActive; }
            set { _isActive = value; }
        }

        public virtual int Nationality
        {
            get { return _nationality; }
            set { _nationality = value; }
        }

        public virtual int Sex
        {
            get { return _sex; }
            set { _sex = value; }
        }

        public virtual string Address
        {
            get { return _address; }
            set
            {
                if (value != null && value.Length > 16)
                    throw new ArgumentOutOfRangeException("Invalid value for Address", value, value.ToString());
                _address = value;
            }
        }

        public virtual string RealName
        {
            get { return _realName; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for RealName", value, value.ToString());
                _realName = value;
            }
        }

        public virtual DateTime CreateTime
        {
            get { return _createTime; }
            set { _createTime = value; }
        }

        public virtual IList UserDocumentses
        {
            get
            {
                if (_userDocumentses == null)
                {
                    _userDocumentses = new ArrayList();
                }
                return _userDocumentses;
            }
            set { _userDocumentses = value; }
        }

        public virtual IList UserOrderses
        {
            get
            {
                if (_userOrderses == null)
                {
                    _userOrderses = new ArrayList();
                }
                return _userOrderses;
            }
            set { _userOrderses = value; }
        }


        #endregion

    }
}
